/**
 * 
 */
package org.gov.vis.data.gui;

import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import org.gov.vis.components.VISTextField;
import org.gov.vis.data.gui.listener.EditDistributionSemenListener;
import org.gov.vis.gui.VisBaseDialog;
import org.gov.vis.gui.util.GuiUtil;
import org.gov.vis.util.DBConstants;

import com.toedter.calendar.JDateChooser;

/**
 * @author user
 *
 */
public class EditDistributionSemenDialog extends VisBaseDialog{



	/**
	 * 
	 */
	private static final long serialVersionUID = -1893187200083002177L;
	private JLabel lblDODistribution;
	private VISTextField txtFldDSDODistribution;
	private JLabel lblBreed;
	private JLabel lblBullNo;
	private JLabel lblNoOfStraws;
	private JPanel pnlMessage;
	private JButton btnReset;
	private JButton btnSave;
	private JPanel btnDSPanel;
	private VISTextField txtFldDSDiscord;
	private JLabel lblDiscord;
	private VISTextField txtFldDSValue;
	private JLabel lblValue;
	private VISTextField txtFldDSNoOfStraws;
	private VISTextField txtFldDSBullNo;
	private VISTextField txtFldDSBreed;
	private VISTextField txtFldDSCode;
	private JLabel lblCode;
	private JPanel pnlDSPanel;
	private JDateChooser dtChoDateOfDistribution;
	private Object hidnObject;
	private String searchText;
	/**
	 * @param owner
	 * @param title
	 * @param modal
	 */
	public EditDistributionSemenDialog(Frame owner, String title, boolean modal) {
		super(owner, title, modal);
		// TODO Auto-generated constructor stub
		initGUI();
		GuiUtil.CompCenterCords cords=GuiUtil.getCompCenterCords(500, 400);
		setBounds(cords.getX(), cords.getY(), 500, 400);		
	}

	private void initGUI() {
		GridBagLayout thisLayout = new GridBagLayout();
		thisLayout.rowWeights = new double[] {0.1};
		thisLayout.rowHeights = new int[] {7};
		thisLayout.columnWeights = new double[] {0.1};
		thisLayout.columnWidths = new int[] {7};
		getContentPane().setLayout(thisLayout);
		{
			pnlDSPanel = new JPanel();
			GridBagLayout pnlDSPanelLayout = new GridBagLayout();
			pnlDSPanelLayout.columnWidths = new int[] {7, 7, 7, 7, 7};
			pnlDSPanelLayout.rowHeights = new int[] {7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7};
			pnlDSPanelLayout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.1, 0.0};
			pnlDSPanelLayout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
			getContentPane().add(pnlDSPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
			pnlDSPanel.setLayout(pnlDSPanelLayout);
			{
				lblCode = new JLabel();
				pnlDSPanel.add(lblCode, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblCode.setText(setFieldLabel(getResources().getString("dialog_label_ai_code"), true));
			}
			{
				txtFldDSCode = new VISTextField();
				pnlDSPanel.add(txtFldDSCode, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				lblDODistribution = new JLabel();
				pnlDSPanel.add(lblDODistribution, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblDODistribution.setText(setFieldLabel(getResources().getString("dialog_label_dist_semen_dtofdistr"), true));
			}
			{
				//txtFldDSDODistribution = new VISTextField();
				//pnlDSPanel.add(txtFldDSDODistribution, new GridBagConstraints(3, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
				dtChoDateOfDistribution = new JDateChooser(null,DBConstants.DISPLAY_DATE_FORMAT);
				dtChoDateOfDistribution.setPreferredSize(txtFldDSCode.getPreferredSize());
				pnlDSPanel.add(dtChoDateOfDistribution, new GridBagConstraints(3, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
		
			}
			{
				lblBreed = new JLabel();
				pnlDSPanel.add(lblBreed, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblBreed.setText(setFieldLabel(getResources().getString("dialog_label_dist_semen_breed"), false));
			}
			{
				txtFldDSBreed = new VISTextField();
				pnlDSPanel.add(txtFldDSBreed, new GridBagConstraints(3, 6, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				lblBullNo = new JLabel();
				pnlDSPanel.add(lblBullNo, new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblBullNo.setText(setFieldLabel(getResources().getString("dialog_label_dist_semen_bullno"), true));
			}
			{
				txtFldDSBullNo = new VISTextField();
				pnlDSPanel.add(txtFldDSBullNo, new GridBagConstraints(3, 8, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				lblNoOfStraws = new JLabel();
				pnlDSPanel.add(lblNoOfStraws, new GridBagConstraints(1, 10, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblNoOfStraws.setText(setFieldLabel(getResources().getString("dialog_label_dist_semen_nostrwas"), false));
			}
			{
				txtFldDSNoOfStraws = new VISTextField();
				pnlDSPanel.add(txtFldDSNoOfStraws, new GridBagConstraints(3, 10, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				lblValue = new JLabel();
				pnlDSPanel.add(lblValue, new GridBagConstraints(1, 12, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblValue.setText(setFieldLabel(getResources().getString("dialog_labdialog_label_dist_semen_code"), false));
			}
			{
				txtFldDSValue = new VISTextField();
				pnlDSPanel.add(txtFldDSValue, new GridBagConstraints(3, 12, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				lblDiscord = new JLabel();
				pnlDSPanel.add(lblDiscord, new GridBagConstraints(1, 14, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblDiscord.setText(setFieldLabel(getResources().getString("dialog_label_dist_semen_discord"), false));
			}
			{
				txtFldDSDiscord = new VISTextField();
				pnlDSPanel.add(txtFldDSDiscord, new GridBagConstraints(3, 14, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				btnDSPanel = new JPanel();
				pnlDSPanel.add(btnDSPanel, new GridBagConstraints(3, 16, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				{
					pnlMessage = new JPanel();
					GridBagLayout jPanel1Layout = new GridBagLayout();
					pnlDSPanel.add(pnlMessage, new GridBagConstraints(1, 1, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
					jPanel1Layout.rowWeights = new double[] {0.1};
					jPanel1Layout.rowHeights = new int[] {7};
					jPanel1Layout.columnWeights = new double[] {0.1};
					jPanel1Layout.columnWidths = new int[] {7};
					pnlMessage.setLayout(jPanel1Layout);
				}
				{
					btnSave = new JButton();
					btnDSPanel.add(btnSave);
					btnSave.setText(getResources().getString("dialog_button_update"));
					btnSave.addActionListener(new EditDistributionSemenListener(this));
				}
				{
					btnReset = new JButton();
					btnDSPanel.add(btnReset);
					btnReset.setText(getResources().getString("dialog_button_delete"));
					btnReset.addActionListener(new EditDistributionSemenListener(this));
				}
			}
		}
		this.setSize(500, 400);
		// TODO Auto-generated method stub
		
	}

	public JPanel getjPanel1() {
		return pnlMessage;
	}


	/**
	 * @return the lblDODistribution
	 */
	public JLabel getLblDODistribution() {
		return lblDODistribution;
	}

	/**
	 * @param lblDODistribution the lblDODistribution to set
	 */
	public void setLblDODistribution(JLabel lblDODistribution) {
		this.lblDODistribution = lblDODistribution;
	}

	/**
	 * @return the txtFldDSDODistribution
	 */
	public VISTextField getTxtFldDSDODistribution() {
		return txtFldDSDODistribution;
	}

	/**
	 * @param txtFldDSDODistribution the txtFldDSDODistribution to set
	 */
	public void setTxtFldDSDODistribution(VISTextField txtFldDSDODistribution) {
		this.txtFldDSDODistribution = txtFldDSDODistribution;
	}

	/**
	 * @return the lblBreed
	 */
	public JLabel getLblBreed() {
		return lblBreed;
	}

	/**
	 * @param lblBreed the lblBreed to set
	 */
	public void setLblBreed(JLabel lblBreed) {
		this.lblBreed = lblBreed;
	}

	/**
	 * @return the lblBullNo
	 */
	public JLabel getLblBullNo() {
		return lblBullNo;
	}

	/**
	 * @param lblBullNo the lblBullNo to set
	 */
	public void setLblBullNo(JLabel lblBullNo) {
		this.lblBullNo = lblBullNo;
	}

	/**
	 * @return the lblNoOfStraws
	 */
	public JLabel getLblNoOfStraws() {
		return lblNoOfStraws;
	}

	/**
	 * @param lblNoOfStraws the lblNoOfStraws to set
	 */
	public void setLblNoOfStraws(JLabel lblNoOfStraws) {
		this.lblNoOfStraws = lblNoOfStraws;
	}

	/**
	 * @return the btnReset
	 */
	public JButton getBtnReset() {
		return btnReset;
	}

	/**
	 * @param btnReset the btnReset to set
	 */
	public void setBtnReset(JButton btnReset) {
		this.btnReset = btnReset;
	}

	/**
	 * @return the btnSave
	 */
	public JButton getBtnSave() {
		return btnSave;
	}

	/**
	 * @param btnSave the btnSave to set
	 */
	public void setBtnSave(JButton btnSave) {
		this.btnSave = btnSave;
	}

	/**
	 * @return the btnDSPanel
	 */
	public JPanel getBtnDSPanel() {
		return btnDSPanel;
	}

	/**
	 * @param btnDSPanel the btnDSPanel to set
	 */
	public void setBtnDSPanel(JPanel btnDSPanel) {
		this.btnDSPanel = btnDSPanel;
	}

	/**
	 * @return the txtFldDSDiscord
	 */
	public VISTextField getTxtFldDSDiscord() {
		return txtFldDSDiscord;
	}

	/**
	 * @param txtFldDSDiscord the txtFldDSDiscord to set
	 */
	public void setTxtFldDSDiscord(VISTextField txtFldDSDiscord) {
		this.txtFldDSDiscord = txtFldDSDiscord;
	}

	/**
	 * @return the lblDiscord
	 */
	public JLabel getLblDiscord() {
		return lblDiscord;
	}

	/**
	 * @param lblDiscord the lblDiscord to set
	 */
	public void setLblDiscord(JLabel lblDiscord) {
		this.lblDiscord = lblDiscord;
	}

	/**
	 * @return the txtFldDSValue
	 */
	public VISTextField getTxtFldDSValue() {
		return txtFldDSValue;
	}

	/**
	 * @param txtFldDSValue the txtFldDSValue to set
	 */
	public void setTxtFldDSValue(VISTextField txtFldDSValue) {
		this.txtFldDSValue = txtFldDSValue;
	}

	/**
	 * @return the lblValue
	 */
	public JLabel getLblValue() {
		return lblValue;
	}

	/**
	 * @param lblValue the lblValue to set
	 */
	public void setLblValue(JLabel lblValue) {
		this.lblValue = lblValue;
	}

	/**
	 * @return the txtFldDSNoOfStraws
	 */
	public VISTextField getTxtFldDSNoOfStraws() {
		return txtFldDSNoOfStraws;
	}

	/**
	 * @param txtFldDSNoOfStraws the txtFldDSNoOfStraws to set
	 */
	public void setTxtFldDSNoOfStraws(VISTextField txtFldDSNoOfStraws) {
		this.txtFldDSNoOfStraws = txtFldDSNoOfStraws;
	}

	/**
	 * @return the txtFldDSBullNo
	 */
	public VISTextField getTxtFldDSBullNo() {
		return txtFldDSBullNo;
	}

	/**
	 * @param txtFldDSBullNo the txtFldDSBullNo to set
	 */
	public void setTxtFldDSBullNo(VISTextField txtFldDSBullNo) {
		this.txtFldDSBullNo = txtFldDSBullNo;
	}

	/**
	 * @return the txtFldDSBreed
	 */
	public VISTextField getTxtFldDSBreed() {
		return txtFldDSBreed;
	}

	/**
	 * @param txtFldDSBreed the txtFldDSBreed to set
	 */
	public void setTxtFldDSBreed(VISTextField txtFldDSBreed) {
		this.txtFldDSBreed = txtFldDSBreed;
	}

	/**
	 * @return the txtFldDSCode
	 */
	public VISTextField getTxtFldDSCode() {
		return txtFldDSCode;
	}

	/**
	 * @param txtFldDSCode the txtFldDSCode to set
	 */
	public void setTxtFldDSCode(VISTextField txtFldDSCode) {
		this.txtFldDSCode = txtFldDSCode;
	}

	/**
	 * @return the lblCode
	 */
	public JLabel getLblCode() {
		return lblCode;
	}

	/**
	 * @param lblCode the lblCode to set
	 */
	public void setLblCode(JLabel lblCode) {
		this.lblCode = lblCode;
	}

	/**
	 * @return the pnlDSPanel
	 */
	public JPanel getPnlDSPanel() {
		return pnlDSPanel;
	}

	/**
	 * @param pnlDSPanel the pnlDSPanel to set
	 */
	public void setPnlDSPanel(JPanel pnlDSPanel) {
		this.pnlDSPanel = pnlDSPanel;
	}

	/**
	 * @return the dtChoDateOfDistribution
	 */
	public JDateChooser getDtChoDateOfDistribution() {
		return dtChoDateOfDistribution;
	}

	/**
	 * @param dtChoDateOfDistribution the dtChoDateOfDistribution to set
	 */
	public void setDtChoDateOfDistribution(JDateChooser dtChoDateOfDistribution) {
		this.dtChoDateOfDistribution = dtChoDateOfDistribution;
	}

	/**
	 * @return the hidnObject
	 */
	public Object getHidnObject() {
		return hidnObject;
	}

	/**
	 * @param hidnObject the hidnObject to set
	 */
	public void setHidnObject(Object hidnObject) {
		this.hidnObject = hidnObject;
	}

	/**
	 * @return the searchText
	 */
	public String getSearchText() {
		return searchText;
	}

	/**
	 * @param searchText the searchText to set
	 */
	public void setSearchText(String searchText) {
		this.searchText = searchText;
	}


}
